package com.zzyl.controller.customer;


import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.service.CustomerProjectService;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customer/orders/project")
@Api(tags = "客户端护理项目模块")
public class CustomerProjectController {

    @Autowired
    private CustomerProjectService customerProjectService;

    @GetMapping("/page")
    @ApiOperation("查询所有项目")
    public ResponseResult list(String name,Integer pageNum,Integer pageSize,Integer status){
        PageResponse<NursingProjectVo> result = customerProjectService.list(name,pageNum,pageSize,status);
        return ResponseResult.success(result);
    }

    @GetMapping("/{id}")
    @ApiOperation("根据id查询项目")
    public ResponseResult getById(@PathVariable Integer id ){
        NursingProjectVo nursingProjectVo = customerProjectService.getById(id);
        return ResponseResult.success(nursingProjectVo);
    }
}
